package com.hnkywl.sts.action.flow.endState;

import com.hnkywl.sts.util.ApplicationInstance;
import com.hnkywl.sts.entity.jhgl.Zgzjjh;
import com.hnkywl.sts.service.jhgl.ZjjhService;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;

/**
 * Created with IntelliJ IDEA.
 * User: jerry
 * Date: 13-5-8
 * Time: 下午2:17
 * To change this template use File | Settings | File Templates.
 */
public class EndZgzjjhState implements EventListener {

    @Override
    public void notify(EventListenerExecution execution) throws Exception {
        // 改变状态  ytj--->ysp
        ZjjhService zjjhService = ApplicationInstance.createZjjhService();
        Zgzjjh zgzjjh = zjjhService.findZgzjjhDetailByProcessInstance(execution.getProcessInstance().getId());
        zgzjjh.setZt("ysp");
        zjjhService.saveZgzjjh(zgzjjh);
    }
}
